//
//  CWaterFall.h
//  HotDisPlus
//
//  Created by yilong zhang on 12-6-13.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

//=========================================================================================================

@interface CWaterDrop : UIView

@property (nonatomic, assign) UIButton      *m_ImgBtn;
@property (nonatomic, assign) UIImageView   *m_Image;
@property (nonatomic, assign) id            m_Obj;          

- (id)initWithFrame:(CGRect)frame Image:(UIImage*)image Tag:(int)tag;
- (void)AddTargetForClickedEvent:(id)target Sel:(SEL)sel;

@end

//=========================================================================================================

@protocol WaterFallDelegate <NSObject>

@optional
- (void)WaterFallSelected:(id)object Index:(int)index;
- (void)DidWaterFallButtom:(id)object;

@end

//=========================================================================================================

@interface CWaterFall : UIView <UIScrollViewDelegate>

@property (nonatomic, assign) id<WaterFallDelegate>     delegate;

@property (nonatomic, assign) UIScrollView  *m_RootPanel;                       //rootview
@property (nonatomic, assign) NSMutableArray*m_Drops;                           //drops
@property (nonatomic, assign) CGSize        m_WaterDropSize;                    //水滴尺寸
@property (nonatomic, assign) int           m_nTotal;                           //水滴数量
@property (nonatomic, assign) int           m_nRows;                            //行数量
@property (nonatomic, assign) int           m_nClos;                            //列数量
@property (nonatomic, assign) int           m_nColCnt;                          //当前列

- (id)initWithFrame:(CGRect)frame ColNum:(int)colnum WaterDropSize:(CGSize)size;
- (void)InitWaterFall;
- (CWaterDrop*)AddWaterDrop:(UIImage*)image;
- (void)OnWaterDropDown:(UIButton*)sender;

@end
